package thread.sisuo.xiezuoduixiangsisuo;

import java.awt.*;

/**
 * 对象之间的协作导致的死锁
 *
 * */
public class Client {

    public static void main(String[] args){

        final Dispatcher dispatcher = new Dispatcher();
        final Taxi taxi  = new Taxi(dispatcher);

        Thread threadA = new Thread(new Runnable() {
            @Override
            public void run() {
                taxi.setLocation(new Point());
            }
        });

        Thread threadB = new Thread(new Runnable() {
            @Override
            public void run() {
                dispatcher.getImage();
            }
        });

        threadA.start();
        threadB.start();


    }



}
